<?php defined('SYSPATH') or die('No direct script access.'); ?>
<?php echo HTML::anchor('category/', 'Back to categories')?>
<h2><?php echo "Attributes for ".$category->name?></h2>

<?php echo Form::open('attribute/add/'.$category->id); ?>
<?php echo Form::input('name', ''); ?>
<?php echo Form::submit('submit', 'Add Attribute');?>
<?php echo Form::close();?>
	
<?php foreach($attributes as $attribute) : ?>
<?php echo $attribute->name; echo ' ';?>
<?php echo HTML::anchor('attribute/delete/'.$attribute->id, 'Delete');?>
	<ul>
	<?php echo Form::open('value/add/'.$attribute->id); ?>
	<?php echo Form::input('value', ''); ?>
	<?php echo Form::submit('submit', 'Add Value');?>
	<?php echo Form::close();?>
	<?php foreach($attribute->values->find_all() as $value) :?>
	<li>
	<?php echo $value->value;?>
	<?php echo HTML::anchor('value/delete/'.$value->id, 'Delete')?>	
	</li>
	<?php endforeach; ?>
	</ul>

<?php endforeach; ?>
<?php echo HTML::anchor('category/', 'Back to categories')?>